using System.Runtime.InteropServices;

namespace Vin.Win32;

public static class VinUser32
{
    #region 剪贴板

    [DllImport("user32.dll")]
    public static extern bool AddClipboardFormatListener(IntPtr hWnd);

    [DllImport("user32.dll")]
    public static extern bool RemoveClipboardFormatListener(IntPtr hWnd);

    public enum ClipboardMsg : uint
    {
        /// <summary>
        /// 剪贴板的内容发生更改时发送
        /// </summary>
        WM_CLIPBOARDUPDATE = 0x031D,
    }

    #endregion

    #region Hook

    // 定义事件类型常量
    public const uint WIN_EVENT_MIN = 0x00000001;
    public const uint WIN_EVENT_MAX = 0x7FFFFFFF;

    // 定义SetWinEventHook函数
    [DllImport("user32.dll")]
    public static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc,
        WinEventProc lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags);

    // 定义UnhookWinEventHook函数
    [DllImport("user32.dll")]
    public static extern bool UnhookWinEvent(IntPtr hWinEventHook);

    // 定义WinEventProc委托
    public delegate void WinEventProc(IntPtr hWinEventHook, WinEventProcType eventType, IntPtr hwnd, int idObject, int idChild,
        uint dwEventThread, uint dwmsEventTime);
    
    public enum WinEventProcType : uint
    {
        
    }

    #endregion
}